/**
 * 功能描述 
 */

define(function (require, exports, module) {
	var Grid = require("grid");
	var aw = require("ajaxwrapper");
	var roomStatus = require("../store/roomStatus");
	var store =require("store");
	var activeUser = store.get("user");
	var Dialog = require("dialog");
	var activeUser = store.get("user");
	var roles = activeUser.roles;
	var enmu = require("enums");
	var Form = require("form");
	
	var role = activeUser.roles;

    var instance = {
        initComponent: function (params,widget) {
        	var grid = new Grid({
        		parentNode:".J-grid",
        		autoRender : false,
        		model:{
        			url:"api/roomregister/queryroombystatus",
        			isCheckbox:true,
        			params:function(){
        				var subnav = widget.get("subnav");
        				return{
        					"orgBuilding":subnav.getValue("buildings"),
        					"roomType":subnav.getValue("roomTypes"),
        					"status":subnav.getValue("status"),
        					orderString:"orgBuilding",
        					orderString:"code",
        					fetchProperties:roomStatus.fetchProperties
        				}
        			},
        			columns:[{
        				name:"roomType.name",
        				label:"房型",
        			},
        			{
        				name:"code",
        				label:"编号",
        			},
        			{
        				name:"acreage",
        				label:"面积",
        			},
        			{
        				name:"orientation.value",
        				label:"朝向",
        			},
        			{
        				name:"orgBuilding.name",
        				label:"所在楼宇",
        			},
        			{
        				name:"floors",
        				label:"所在楼层",
        			},
        			{
        				name:"status.value",
        				label:"房态",
        			},
        			{
        				name:"show",
        				label:"操作",
        				format:"button",
        				formatparams:[{
        					id:"edit",        				
							text:"设置",
							
        					handler:function(index,data,rowEle){
        						widget._betch(widget,false,data)
        					}
        				}]

        			}]
        			
        		}
        	});  
        	widget.set("grid",grid);
        }
    };
    module.exports = instance;
});
